package com.scau.hwadee.examination.controller;

import com.scau.hwadee.examination.service.UserInfoService;
import com.scau.hwadee.examination.vo.ResponseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Map;

/**
 * @author YHX
 * @date 2019/7/28  9:14
 * @description
 */
@Controller
@RequestMapping("/user")
public class UserInfoController {
    @Autowired
    private UserInfoService userInfoService;

    @RequestMapping(value = "/resetPassword", method = RequestMethod.POST)
    public ResponseEntity<ResponseVo> resetPassword(@RequestBody Map<String, Object> map) {
        ResponseVo vo = ResponseVo.instance();
        vo.setMessage(userInfoService.resetPassword(map));
        return new ResponseEntity<>(vo, HttpStatus.OK);
    }
}
